# vim: ts=4:sw=4:syntax=perl

use gri_secmgr qw(get_user_name);
use gri_portal_config;

sub mm_primary_site_role {

	# Give a warning if the role count is not 0.
	my $info=$::GRI_FRONTEND->get_role_count();
	if(defined($info->{error})) {
		return html_error("Error whilst reading role information:<br>$info->{error}",0);
	}
	my $username=get_user_name();
	if(!defined($username) || $username eq "public") {
		return "This page is not available unless properly logged in.";
	}
	if($info->{count}) {
		return "Someone is already defined with admin access for this site.";
	}
	# Ok - provide a link to configuration
	my $cc='Please click the buttom below to gain access to all site roles. Once this has been performed you will be able to apply and change roles for others.<p>
<INPUT TYPE="submit" NAME="submit1" VALUE="Confirm">';
	return $cc;
}

1;
